import request from '@/utils/request'

// 查询物品订单列表
export function listOrder(query) {
  return request({
    url: '/wms/order/list',
    method: 'get',
    params: query
  })
}

// 查询物品订单详细
export function getOrder(id) {
  return request({
    url: '/wms/order/' + id,
    method: 'get'
  })
}

export function getOrderListDeliveryName() {
  return request({
    url: '/wms/warehouse/listDeliveryName',
    method: 'get'
  })
}

export function getOrderListReceiveName() {
  return request({
    url: '/wms/warehouse/listReceiveName',
    method: 'get'
  })
}
export function getOrderListName() {
  return request({
    url: '/wms/warehouse/listName',
    method: 'get'
  })
}

// 新增物品订单
export function addOrder(data) {
  return request({
    url: '/wms/order',
    method: 'post',
    data: data
  })
}

// 修改物品订单
export function updateOrder(data) {
  return request({
    url: '/wms/order',
    method: 'put',
    data: data
  })
}


export function delOrder(id) {
  return request({
    url: '/wms/order/' + id,
    method: 'delete'
  })
}

export function updateOrderStatus(id) {
  return request({
    url: '/wms/order/' + id,
    method: 'put'
  })
}


export function getAreaWarehouse() {
  return request({
    url: '/wms/warehouse/area',
    method: 'get'
  })
}

export function getOrderType() {
  return request({
    url: '/wms/order/getOrderType',
    method: 'get'
  })
}
export function getOrderLine(id) {
  return request({
    url: '/wms/order/getOrderLine/'+id,
    method: 'get'
  })
}
export function PostOrderLine(data) {
  return request({
    url: '/wms/order/PostOrderLine',
    method: 'post',
    data: data
  })
}
export function PutOrderLine(data) {
  return request({
    url: '/wms/order/PutOrderLine/',
    method: 'put',
    data: data
  })
}
export function DeleteOrderLine(data) {
  return request({
    url: '/wms/order/deleteLine/',
    method: 'delete',
    data: data
  })
}
export function deleteLineOne(data) {
  return request({
    url: '/wms/order/deleteLineOne/',
    method: 'delete',
    data: data
  })
}
export function getLineInfo(data) {
  return request({
    url: '/wms/order/getLineInfo',
    method: 'post',
    data: data
  })
}
